<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath(); 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="user" class="com.hebxy.ssm.entity.User" scope="request"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=basePath %>static/js/jquery-2.1.0.js"></script>
<style type="text/css">
	.error{
		color:red;
		font-size:12px;
	}
</style>
</head>
<body>
<h1>用户修改</h1>
	<form:form action="${pageContext.request.contextPath }/admin/updateUser" method="POST" modelAttribute="user">
		<input type="hidden" name="id" value="${user.id }">
		卡号:<form:input path="card_number"/><form:errors path="card_number" class="error"/><br> 
		用户名:<input name="username" value="${user.username }"><br> 
		密码:<input name="password" value="${user.password }"><br> 
		套餐:<select name="plan_id" >
		<c:forEach var="plan" items="${planList }" varStatus="st">
			<option value="${plan.id}" <c:if test="${user.plan_id==plan.id }">selected</c:if> >id:${plan.id } 套餐:${plan.plan_name } 通话时长:${plan.call_time} 上网流量:${plan.data_usage } 短信条数:${plan.sms_count } 资费:${plan.monthly_fee }</option>
		</c:forEach>
		</select><br> 
		预存话费:<input name="prepaid_amount" value="${user.prepaid_amount }">${yebz }<br> 
		状态:<select name=status>
			<option value="1">正常</option>
			<option value="0">异常</option>
		</select><br> 
		权限:<select name=role>
			<option value="user">普通用户</option>
			<option value="admin">管理员</option>
		</select><br>
		<input type="submit" value="修改" onclick="return confirm('确认修改吗？')">
		<input type="button" value="返回" onclick="history.go(-1)">
	</form:form>
</body>
</html>